<template>
    <div>
        <el-upload
                drag
                :action="`${this.$axios.defaults.baseURL}/api/file/upload`"
                :on-success="onSuccess"
                multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
        </el-upload>
        <img :src="imgSrc" alt="">
        <video :src="imgSrc" controls="controls" style="width: 900px;" autoplay></video>
    </div>
</template>

<script>
    export default {
        name: "",
        data() {
            return {
                imgSrc: ''
            }
        },
        methods: {
            onSuccess(res) {
                //            http://localhost:8090          /api/file/md5
                this.imgSrc = this.$axios.defaults.baseURL + res.data.url;
                console.log(res);
            }
        }
    }
</script>

<style scoped>

</style>